package com.qf.listener;

import com.qf.config.RabbitMQConfig;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
public class TopicQueue {

    @RabbitListener(queues = "simple_queue")
    public void listener1(String msg){
        System.out.println("Topic model listener1"+msg);
    }

    @RabbitListener(queues = "simple_queue2")
    public void listener2(String msg){
        System.out.println("Topic model listener2"+msg);
    }


    /*两个消费者，监听两个队列；*/
    @RabbitListener(queues = RabbitMQConfig.TOPICQ1)
    public void listener3(String msg){
        System.out.println("Topic model listener1"+msg);
    }
    @RabbitListener(queues = RabbitMQConfig.TOPICQ2)
    public void listener4(String msg){
        System.out.println("Topic model listener2"+msg);
    }

}
